The HTML source formatting profile determines how Dreamweaver formats the HTML source code for a document. The profile includes formatting preferences for individual tags and groups of tags, along with the HTML Format preferences (set with the Edit > Preferences command). You can edit the SourceFormat.txt file in a text editor for precise control over how Dreamweaver writes HTML. The profile is a text file saved in the Configuration folder within the Dreamweaver application folder.
HTML Format preferences set with the Preferences command are saved in SourceFormat.txt when you quit Dreamweaver, and changes made to the profile do not take effect until you restart Dreamweaver. Thus, to ensure access to the new preference settings, quit the application before editing the profile.
The HTML source formatting profile follows a specific format, which is outlined in the file. Note the following conventions:
![]() |
Each section of the profile begins with <? keyword > (for example, <?OPTIONS> , <?ELEMENTS> , <?ATTRIBUTES> ). |
![]() |
The parameters for each section are defined within HTML comments (<!-- --> ) directly above the section. |
![]() |
The OMIT line in the <?OPTIONS> section is reserved for future use (it currently does not affect HTML source formatting). |
![]() |
An individual tag can be marked as belonging to an indentation group (IGROUP ) in the <?ELEMENTS> section. By default, IGROUP 1 contains table rows and columns, and IGROUP 2 contains framesets and frames. These groupings correspond to the Indent Table Rows and Columns and Indent Framesets and Frames options in the HTML Format Preferences dialog box. Indentation can be turned off for the entire group by removing its number from the ACTIVE attribute in the <?OPTIONS> section. You can also add other tags to IGROUP 1 or 2 so you can control them with the options in the HTML Format Preferences. |
For example, the default settings for the P
tag in SourceFormat.txt are <P BREAK="1,0,0,1" INDENT>
, which produces the following:
<p> A paragraph of text that is indented from the left margin and that has a break before the opening P tag and after the closing P tag, but not after the opening P and not before the closing P.</p><p>Next paragraph.</p>
If you change the settings to <P BREAK="1,1,1,2">
, you will get this:
<p>A paragraph of text that is not indented from the left margin and that has one break before and after the opening P tag, one break before the closing P tag, and two breaks after the closing P tag. </p> <p>Next paragraph. </p>
Some tag and attribute settings include the terms NAMECASE
or SAMECASE
. NAMECASE
specifies that the tag or attribute is to be capitalized in a particular way. For example, onClick
is specified as <onClick namecase="onClick">
, indicating that it should always be capitalized in that specific way, neither all-uppercase nor all-lowercase. Dreamweaver uses SAMECASE
to ensure that it uses the right case (upper or lower) when generating certain attributes; don't remove SAMECASE
from any of the attribute formatting specifications where it appears.
Any attribute not specified in the SourceFormat.txt file uses the default formatting settings that you specify in the HTML Format preferences panel.